A functor to redistribute things in vectors on multiple processes. More...
#include <shuffler.hpp>
Public Types | |
typedef std::vector< Thing > | ThingVector |
typedef std::vector< Index > | IndexVector |
Public Member Functions | |
Shuffler (const Communicator &comm) | |
~Shuffler (void) | |
void | operator() (ThingVector &locthings, const IndexVector &destproc) |
Redistribute and get the Things assigned to the local process. |
A functor to redistribute things in vectors on multiple processes.
Each process starts with a (possibly empty) vector of things and a vector of equal size that containing a destination process for each thing. After execution, each process will contain a vector of the things assigned to it.
This uses blocking send/receive.
The things redistributed must be copy constructable and serializable.
typedef std::vector<Index> gridpack::parallel::Shuffler< Thing, Index >::IndexVector |
typedef std::vector<Thing> gridpack::parallel::Shuffler< Thing, Index >::ThingVector |
gridpack::parallel::Shuffler< Thing, Index >::Shuffler | ( | const Communicator & | comm | ) |
gridpack::parallel::Shuffler< Thing, Index >::~Shuffler | ( | void | ) |
void gridpack::parallel::Shuffler< Thing, Index >::operator() | ( | ThingVector & | locthings, | |
const IndexVector & | destproc | |||
) |
Redistribute and get the Things assigned to the local process.
References gridpack::parallel::Distributed::communicator().